home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d27 / moot.arc / MOOT.DOC < prev    next >
Text File  |  1990-12-31  |  15KB  |  395 lines

  1.                          Multiple Boot (Moot) Utilities
  2.  
  3.                                        by
  4.  
  5.                                    Eric Tauck
  6.                                1304 Deerpass Road
  7.                                 Marengo, IL 60152
  8.  
  9.                              Compuserve: 72457,1557
  10.                        Internet: 72457.1557@compuserve.com
  11.  
  12.      The Moot Utilities are a collection of device drivers and programs for
  13.      implementing multiple DOS boot configurations using single CONFIG.SYS
  14.      and AUTOEXEC.BAT files.  The device drivers CHOOSE, LOAD, and SKIP
  15.      allow specific lines of the CONFIG.SYS file to be processed or
  16.      ignored.  The programs MOOT.COM and INPUT.COM perform similar
  17.      functions for batch files.  Additionally, the device drivers CLEAR,
  18.      MOVE, and ECHO perform display functions from the CONFIG.SYS file.
  19.  
  20.      The files CHOOSE, CLEAR, ECHO, LOAD, MOVE, SKIP are DOS device
  21.      drivers, even though their names do not end with SYS.  You may rename
  22.      these files with a SYS extension as long as you also use the extension
  23.      in the CONFIG.SYS file.  Device drivers are only 'run' via the
  24.      CONFIG.SYS file.  The files INPUT.COM and MOOT.COM are executable
  25.      programs that are usually run from batch files.
  26.  
  27.      If you do not place the device drivers in the root directory, you will
  28.      need to specify a path in the DEVICE= statement.  You may also need to
  29.      specify path when running the programs INPUT.COM and MOOT.COM.
  30.  
  31.      All of the device drivers, except CHOOSE, automatically remove
  32.      themselves from memory once they have executed.  CHOOSE can be
  33.      configured to remain resident or remove itself from memory.  When
  34.      CHOOSE remains in memory, MOOT.COM can retrieve the configuration
  35.      selection.
  36.  
  37.      The string arguments for the device drivers consist of sequences of
  38.      characters enclosed by double-quote characters (").  Special back-
  39.      slash codes may be used within strings:
  40.  
  41.        \"  double quote character
  42.        \a  sound speaker (audible)
  43.        \f  clear screen and move cursor to upper left (formfeed)
  44.        \n  carriage return / linefeed (newline)
  45.  
  46.      Note that DOS usually converts the CONFIG.SYS file into uppercase
  47.      when it is loaded, thus all letters in strings will be in uppercase.
  48.  
  49.      The keystroke arguments for CHOOSE and INPUT.COM consist of an ASCII
  50.      code for standard keys and a negative scan code for special keys.  The
  51.      codes for some commonly used keys are:
  52.  
  53.        Backspace          8
  54.        Tab                9
  55.        Enter              13
  56.        Escape             27
  57.  
  58.        0 to 9             48 to 57
  59.  
  60.        a to z             97 to 122
  61.        A to Z             65 to 90
  62.        Ctrl-A to Ctrl-Z   1 to 26
  63.  
  64.        Left               -75
  65.        Right              -77
  66.        Up                 -72
  67.        Down               -80
  68.        Page Up            -73
  69.        Page Down          -81
  70.        Home               -71
  71.        End                -79
  72.  
  73.        Insert             -82
  74.        Delete             -83
  75.  
  76.        F1 to F10          -59 to -68
  77.  
  78.      The keystrokes for the device drivers are case-insensitive.  The
  79.      keystrokes for INPUT.COM are case-insensitive only when the /U option
  80.      is used.
  81.  
  82.      The color argument for CLEAR is a standard attribute byte.  An
  83.      attribute byte consists of a color value (the foreground) plus a color
  84.      value times 16 (the background).  Adding 8 to the attribute makes the
  85.      foreground color brighter and adding 128 to the attribute makes the
  86.      foreground blink.  The color values are:
  87.  
  88.        Black     0
  89.        Blue      1
  90.        Green     2
  91.        Cyan      3
  92.        Red       4
  93.        Magenta   5
  94.        Brown     6
  95.        White     7
  96.  
  97.      Example: the attribute for bright white on blue is (Blue * 16) + White
  98.      + 8 = (1 * 16) + 7 + 8 = 31.
  99.  
  100.      The programs INPUT.COM and MOOT.COM return an error code based on user
  101.      input and the CHOOSE selection.  This error code is accessed in a
  102.      batch file using the IF ERRORLEVEL batch command.
  103.  
  104.      The Moot Utilities have only been tested on PC DOS 3.2, MS DOS 4.01,
  105.      and PC DOS 4.01.  Before changing the CONFIG.SYS and AUTOEXEC.BAT
  106.      files on your hard disk, you should create a boot floppy from which to
  107.      test the Moot Utilities and make sure they work properly on your
  108.      system.
  109.  
  110.      What follows is a a description of each of the device drivers and
  111.      programs.  At the end of this document are example CONFIG.SYS files
  112.      and batch files using the Moot Utilities.
  113.  
  114.                                      CHOOSE
  115.                                      ------
  116.  
  117.      The CHOOSE device driver allows you to dynamically select one of up to
  118.      nine different blocks of lines in the CONFIG.SYS file to be processed.
  119.      When CHOOSE is executed, the user will be prompted for the
  120.      configuration to use.  The CONFIG.SYS file may contain multiple CHOOSE
  121.      statements, as long as the blocks are not overlapped or nested.  The
  122.      syntax for CHOOSE is:
  123.  
  124.        DEVICE=CHOOSE [prompt] [time] [default] [0]
  125.  
  126.        DEVICE=#1 [prompt] key
  127.  
  128.        :
  129.        <normal CONFIG.SYS statements>
  130.        :
  131.  
  132.        DEVICE=#2 [prompt] key
  133.  
  134.        :
  135.        <normal CONFIG.SYS statements>
  136.        :
  137.  
  138.        DEVICE=#END [prompt]
  139.  
  140.        -----
  141.  
  142.        prompt   A string to display.
  143.  
  144.        time     The number of seconds to wait for a response from the user.
  145.                 If the user does not respond, the default configuration
  146.                 block is used.  If no time is specified, CHOOSE will wait
  147.                 indefinitely.
  148.  
  149.        default  The default configuration block number to use if no key is
  150.                 pressed.  This value must be in the range 1 to 9 (it is not
  151.                 range checked).  If no default is specified, the first
  152.                 block will be selected.
  153.  
  154.        0        If zero is specified on the CHOOSE line, the resident
  155.                 kernel of CHOOSE will not be loaded.  Use this option if
  156.                 you do not need MOOT.COM to check the configuration or you
  157.                 use multiple CHOOSE commands.
  158.  
  159.        key      The keystroke that selects this block.
  160.  
  161.      When a choice is made, by keystroke or default, one (and only one) of
  162.      the configuration statement blocks delimited by the #1, #2, ..., #9,
  163.      or #END device statements will be loaded.
  164.  
  165.      Note: the device names #1 through #9 and #END are only used to delimit
  166.      blocks of statements.  If CHOOSE works properly, the operating system
  167.      will not attempt to load these statements as devices.  The character
  168.      sequences #1, #2, #3, #4, #5, #6, #7, #8, #9, and #END can only be
  169.      used as part of a CHOOSE.
  170.  
  171.      All the prompts are optional.  If a prompt is specified with the #END
  172.      statement, the keystroke will be echoed, otherwise the keystroke will
  173.      not be echoed.
  174.  
  175.      CHOOSE remains resident by default.  If zero is specified on the
  176.      command line, CHOOSE will not remain resident.  If CHOOSE remains
  177.      resident, MOOT will return the selection number.  If multiple CHOOSE's
  178.      are resident, MOOT will return the selection number of the last CHOOSE
  179.      loaded.  CHOOSE uses less than 150 bytes of memory when resident.
  180.  
  181.      The CHOOSE driver may crash if a default value is greater than 9 or
  182.      there is no #END statement.
  183.  
  184.                                       CLEAR
  185.                                       -----
  186.  
  187.      The CLEAR device clears the screen.  The syntax for CLEAR is:
  188.  
  189.        DEVICE=CLEAR [color]
  190.  
  191.        -----
  192.  
  193.        color  An attribute byte.
  194.  
  195.      If no color is specified, the attribute at the cursor location is used.
  196.  
  197.                                       ECHO
  198.                                       ----
  199.  
  200.      The ECHO device displays a string.  The syntax for ECHO is:
  201.  
  202.        DEVICE=ECHO string
  203.  
  204.        -----
  205.  
  206.        string  The string to display.
  207.  
  208.                                     INPUT.COM
  209.                                     ---------
  210.  
  211.      This program waits for specific keystrokes and returns an error code
  212.      based on the keystroke.  Batch files can use this code to branch for
  213.      specific input.  The syntax for INPUT.COM is:
  214.  
  215.        INPUT [/U] [/E] [/Tn] [/Dn] n[, n, ...]
  216.  
  217.        -----
  218.  
  219.        /E   Echo the keystroke.
  220.  
  221.        /U   Convert all ASCII codes to uppercase.  This option makes the
  222.             input case-insensitive.
  223.  
  224.        /Fn  Display the file n before input.  This option lets you set up
  225.             the screen before performing the input.  If you have ANSI.SYS
  226.             loaded, you can clear the screen and position the cursor using
  227.             ANSI sequences imbedded in the file.
  228.  
  229.        /Tn  Wait n seconds for response.  If no response if given, the
  230.             default (/D) value is returned.  If this option is not
  231.             specified, INPUT.COM waits indefinitely for input.
  232.  
  233.        /Dn  Return code n if timeout.  If this option is not specified,
  234.             INPUT.COM will return 0.  This option is only meaningful when
  235.             the /T option is used.
  236.  
  237.        n    A keystroke to wait for.  Multiple keystrokes may be specified
  238.             and at least one keystroke is required. The error code returned
  239.             is based on the position of the keystroke on the command line.
  240.             The first keystroke returns error code 1, the second returns
  241.             error code 2, etc.
  242.  
  243.                                       LOAD
  244.                                       ----
  245.  
  246.      The LOAD device lets you selectively load or ignore the next line in
  247.      the CONFIG.SYS file.  When LOAD is executed, you are prompted as to
  248.      whether or not you wish to load the next line.  The syntax for LOAD
  249.      is:
  250.  
  251.        DEVICE=LOAD prompt [time]
  252.  
  253.        -----
  254.  
  255.        prompt  The prompt to display.  A " (Y/N)? " is automatically
  256.                appended to the string.
  257.  
  258.        time    The number of seconds to wait for a response from the user.
  259.                If the user does not respond, the next CONFIG.SYS line will
  260.                not be loaded.  If no time is specified, LOAD will wait
  261.                indefinitely.
  262.  
  263.                                     MOOT.COM
  264.                                     --------
  265.  
  266.      This program returns the selection number (1 to 9) from the CHOOSE
  267.      driver.  Batch files can use this code to branch for specific CHOOSE
  268.      configurations.  A code of 0 is returned if the CHOOSE driver isn't
  269.      installed and a code of 255 if CHOOSE is installed but detected an
  270.      installation error.  The syntax for MOOT.COM is:
  271.  
  272.        MOOT
  273.  
  274.                                       MOVE
  275.                                       ----
  276.  
  277.      The MOVE device positions the cursor, presumably before something is
  278.      displayed.  The syntax for MOVE is:
  279.  
  280.        DEVICE=MOVE row column
  281.  
  282.        -----
  283.  
  284.        row     is the screen row
  285.  
  286.        column  is the screen column
  287.  
  288.                                       SKIP
  289.                                       ----
  290.  
  291.      The LOAD device lets you selectively skip or load the next line in the
  292.      CONFIG.SYS file.  When SKIP is executed, you are prompted as to
  293.      whether or not you wish to skip the next line.  The syntax for SKIP
  294.      is:
  295.  
  296.        DEVICE=SKIP prompt [time]
  297.  
  298.        -----
  299.  
  300.        prompt  The prompt to display.  A " (Y/N)? " is automatically
  301.                appended to the string.
  302.  
  303.        time    The number of seconds to wait for a response from the user.
  304.                If the user does not respond, the next CONFIG.SYS line is
  305.                will not be skipped.  If no time is specified, SKIP will
  306.                wait indefinitely.
  307.  
  308.                                     Examples
  309.                                     --------
  310.  
  311.      Here are example CONFIG.SYS and AUTOEXEC.BAT files, which are similar
  312.      to the actual files I use on my system.  Note that the Moot files are
  313.      stored in a directory called BOOT on drive C:.
  314.  
  315.      This CONFIG.SYS has three basic configurations: standard, minimum, and
  316.      debugging.  The configuration is selected by pressing a number one,
  317.      two, or three.  The standard configuration is used most of the time
  318.      and is selected by default after four seconds.  The minimum
  319.      configuration loads as little as possible for high memory requirement
  320.      applications.  The debugging configuration forces my disk cache
  321.      (NCACHE-S) to leave 640K of extended memory available so I can perform
  322.      virtual debugging with Turbo Debugger.  The standard configuration
  323.      also allows me to optionally load the device driver TDH386.SYS.
  324.  
  325.        CONFIG.SYS
  326.        ----------
  327.  
  328.          device=c:\boot\CHOOSE "\f+--------------+"  4
  329.  
  330.          device=#1 "| 1. STANDARD  |" 49
  331.  
  332.          buffers=7
  333.          stacks=8,64
  334.          device=c:\os\ramdrive.sys 566 512 32 /e
  335.          device=c:\os\himem.sys
  336.          device=C:\boot\LOAD "LOAD TD386" 3
  337.          device=c:\td\tdh386.sys
  338.          device=c:\nu\ncache-s.exe /-w a: -a b: -a
  339.  
  340.          device=#2 "| 2. MINIMUM   |" 50
  341.  
  342.          buffers=10
  343.          stacks=0,0
  344.          lastdrive=f
  345.  
  346.          device=#3 "| 3. DEBUGGING |\n+--------------+" 51
  347.  
  348.          buffers=7
  349.          stacks=8,64
  350.          device=c:\os\ramdrive.sys 557 512 32 /e
  351.          device=c:\td\tdh386.sys
  352.          device=c:\nu\ncache-s.exe /ext=-640 /-w a: -a b: -a
  353.  
  354.          device=#END
  355.  
  356.      This AUTOEXEC.BAT reflects the three main configurations stored in the
  357.      CONFIG.SYS file.  The first action performed is to run MOOT.COM to
  358.      retrieve the configuration selection.  The standard and debugging
  359.      configurations jump to the same locations.  My menu system is started
  360.      by running C:\BAT\M, and at the end of this file, a prompt is
  361.      displayed and if <ESC> is pressed in four seconds, my menu system is
  362.      skipped.  If <SPACE> or <ENTER> is pressed, the menu system is entered
  363.      immediately.  INPUT.COM is used to enter or skip the menu system.  The
  364.      prompt displayed by INPUT.COM is stored in the file MENU.TXT.
  365.  
  366.        AUTOEXEC.BAT
  367.        ------------
  368.  
  369.          c:\boot\moot
  370.          IF ERRORLEVEL 3 GOTO standard
  371.          IF ERRORLEVEL 2 GOTO minimum
  372.          IF ERRORLEVEL 1 GOTO standard
  373.  
  374.          :standard
  375.  
  376.          c:\boot\mouse
  377.          GOTO done
  378.  
  379.          :minimum
  380.  
  381.          c:\os\subst f: c:\trash
  382.          GOTO done
  383.  
  384.          :done
  385.          set nu=c:\nu
  386.          CALL c:\bat\normal
  387.  
  388.          c:\boot\input /fc:\boot\menu.txt /t4 32 13 27
  389.          IF ERRORLEVEL 3 GOTO skip
  390.          c:\bat\m
  391.  
  392.          :skip
  393.          c:
  394.          cls
  395.